/**
 * This file is part of Sonedyan.
 * 
 * Sonedyan is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation;
 * either version 3 of the License, or (at your option) any
 * later version.
 *
 * Sonedyan is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public
 * License along with Octave; see the file COPYING.  If not
 * see <http://www.gnu.org/licenses/>.
 * 
 * Copyright (C) 2009-2012 Jimmy Dubuisson <jimmy.dubuisson@gmail.com>
 */

package org.unige.mpej.eckmann.sonedyan.enron.utils;

import java.util.Vector;
import org.apache.log4j.Logger;

import org.unige.mpej.eckmann.sonedyan.enron.bean.Actor;
import org.unige.mpej.eckmann.sonedyan.enron.bean.Link;

import edu.uci.ics.jung.graph.Graph;

/**
 * Set of graph util methods
 */
public class GraphUtils 
{
	private static Logger log = Logger.getLogger(org.unige.mpej.eckmann.sonedyan.enron.utils.GraphUtils.class);

	private static final String[] KNOWN_ACTOR_IDS = { 
		"paul.y'barbo","bill.williams","jason.williams","steven.south","matt.smith",
		"monique.sanchez","robin.rodrigue","dutch.quigley","debra.perlingiere","steven.merris",
		"mike.mcconnell","jeffrey.hodge","jenny.helton","rob.gay","clint.dean",
		"scott.hendrickson","stephen.harris","john.griffith","lisa.gang","lynn.blair",
		"michelle.cash","monika.causholli","stacy.dickson","joe.quenet","danny.mccarty",
		"richard.sanders","marie.heard","paul.lucci","mark.whitt","philip.allen",
		"stephanie.panus","susan.pereira","theresa.staab","mark.taylor","richard.ring",
		"teb.lokey","tracy.geaccone","kevin.hyatt","lindy.donoho","kimberly.watson",
		"james.steffes","john.forney","jay.reitmeyer","elizabeth.sager","darrell.schoolcraft",
		"bill.rapp","shelley.corman","kim.ward","juan.hernandez","joe.stepenovitch",
		"jeffrey.shankman","dana.davis","tori.kuykendall","randall.gay","larry.campbell",
		"david.delainey","tana.jones","susan.scott","susan.bailey","steven.kean",
		"kay.mann","john.lavorato","greg.whalley","jason.wolfe","jim.schwieger",
		"matthew.lenhart","peter.keavey","tom.donohoe","mark.haedicke","stanley.horton",
		"rod.hayslett","richard.shapiro","michelle.lokay","jeff.dasovich","gerald.nemec",
		"john.zufferli","andy.zipper","stacey.white","charles.weldon","judy.townsend",
		"paul.thomas","geir.solberg","cara.semperger","holden.salisbury","eric.saibi",
		"andrea.ring","cooper.richey","phillip.platter","vladi.pimenov","joe.parks",
		"patrice.mims","albert.meyers","errol.mclaughlin","phillip.love","louise.kitchen",
		"vince.kaminski","john.hodge","daron.giron","mary.fischer","daren.farmer",
		"chris.dorland","mike.carson","sally.beck","rick.buy","don.baughman",
		"kam.keiser","jeffery.skilling","ryan.slinger","mike.swerzbin","diana.scholtes",
		"craig.dean","drew.fossum","mark.guzman","james.derrick","mary.hain",
		"dan.hyvl","eric.linder","carol.clair","chris.stokley","kate.symes",
		"kenneth.lay","keith.holst","jeff.king","jonathan.mckay","jane.tholt",
		"michael.grigsby","scott.neal","mark.fisher","douglas.gilberth-smith","bradley.mckay",
		"kevin.ruscitti","martin.cuilla","sean.crandall","eric.bass","harry.arora",
		"sandra.brawner","barry.tycholiz","geoffery.storey","andrew.lewis","rogers.herndon",
		"larry.may","michael.maggi","frank.ermis","thomas.martin","robert.badeer",
		 "fletcher.sturm","hunter.shively","robert.benson","mark.davis","kevin.presto",
		 "matthew.motley","timothy.belden","john.arnold","judy.hernandez","sara.shackleton" };
	
	// Nodes removed: 
	// richard.ring,judy.townsend,andrew.lewis,mike.carson,lynn.blair,darrell.schoolcraft,
	// lisa.gang,mary.fischer,judy.hernandez,susan.pereira
	public static final String[] MOST_LINKED_KNOWN_ACTOR_IDS = { 
		"paul.y'barbo","bill.williams","jason.williams","steven.south","matt.smith",
		"monique.sanchez","robin.rodrigue","dutch.quigley","debra.perlingiere","steven.merris",
		"mike.mcconnell","jeffrey.hodge","jenny.helton","rob.gay","clint.dean",
		"scott.hendrickson","stephen.harris","john.griffith",
		"michelle.cash","monika.causholli","stacy.dickson","joe.quenet","danny.mccarty",
		"richard.sanders","marie.heard","paul.lucci","mark.whitt","philip.allen",
		"stephanie.panus","theresa.staab","mark.taylor",
		"teb.lokey","tracy.geaccone","kevin.hyatt","lindy.donoho","kimberly.watson",
		"james.steffes","john.forney","jay.reitmeyer","elizabeth.sager",
		"bill.rapp","shelley.corman","kim.ward","juan.hernandez","joe.stepenovitch",
		"jeffrey.shankman","dana.davis","tori.kuykendall","randall.gay","larry.campbell",
		"david.delainey","tana.jones","susan.scott","susan.bailey","steven.kean",
		"kay.mann","john.lavorato","greg.whalley","jason.wolfe","jim.schwieger",
		"matthew.lenhart","peter.keavey","tom.donohoe","mark.haedicke","stanley.horton",
		"rod.hayslett","richard.shapiro","michelle.lokay","jeff.dasovich","gerald.nemec",
		"john.zufferli","andy.zipper","stacey.white","charles.weldon",
		"paul.thomas","geir.solberg","cara.semperger","holden.salisbury","eric.saibi",
		"andrea.ring","cooper.richey","phillip.platter","vladi.pimenov","joe.parks",
		"patrice.mims","albert.meyers","errol.mclaughlin","phillip.love","louise.kitchen",
		"vince.kaminski","john.hodge","daron.giron","daren.farmer",
		"chris.dorland","sally.beck","rick.buy","don.baughman",
		"kam.keiser","jeffery.skilling","ryan.slinger","mike.swerzbin","diana.scholtes",
		"craig.dean","drew.fossum","mark.guzman","james.derrick","mary.hain",
		"dan.hyvl","eric.linder","carol.clair","chris.stokley","kate.symes",
		"kenneth.lay","keith.holst","jeff.king","jonathan.mckay","jane.tholt",
		"michael.grigsby","scott.neal","mark.fisher","douglas.gilberth-smith","bradley.mckay",
		"kevin.ruscitti","martin.cuilla","sean.crandall","eric.bass","harry.arora",
		"sandra.brawner","barry.tycholiz","geoffery.storey","rogers.herndon",
		"larry.may","michael.maggi","frank.ermis","thomas.martin","robert.badeer",
		 "fletcher.sturm","hunter.shively","robert.benson","mark.davis","kevin.presto",
		 "matthew.motley","timothy.belden","john.arnold","sara.shackleton" };
	
	public static Vector<String> knownActorIds;
	public static Vector<String> mostLinkedKnownActorIds;
	
	static 
	{
		knownActorIds = new Vector<String>();
		
		for (String s : KNOWN_ACTOR_IDS)
		{
			knownActorIds.add(s);
		}
		
		mostLinkedKnownActorIds = new Vector<String>();
		
		for (String s : MOST_LINKED_KNOWN_ACTOR_IDS)
		{
			mostLinkedKnownActorIds.add(s);
		}
	}

	/**
	 * get known actors subgraph
	 */
	public static Graph<Actor, Link> getUndirectedKnownActorsSubGraph(Graph<Actor, Link> g)
	{
		return org.unige.mpej.eckmann.sonedyan.utils.GraphUtils.getSubGraph(g, knownActorIds);
	}
	
}
